export default {
  // 命名空间
  namespaced: true,
  state: {
    selectedAddress: {}
  },
  getters: {},
  mutations: {
    setSelectedAddress (state, payload) {
      const pages = getCurrentPages()
      // 查找到上一页的名字
      const current = pages[pages.length - 1]
      // console.log(current)
      // 判断上一页是order 才执行跳转
      if (current.options.from === 'order') {
        state.selectedAddress = payload
        uni.navigateBack()
      }
    }
  },
  actions: {}
}
